#include<iostream>
using namespace std;
int main()
{
	char ch;
	int n;
	bool flag = false;
	while ((cin >> ch&&(ch!='@'))) {
		getchar();
		if (flag) {
			cout << endl;
		}
		cin >> n;
		for (int i = 0; i < n; i++) {
			if (i == 0) {
				for (int j = n - 1; j >= 1; j--) {
					cout << " ";
				}
				cout << (char)ch << endl;
			}
			else if (i == n - 1) {
				for (int j = 0; j < 2 * n - 1; j++) {
					cout << (char)ch;
				}
				cout << endl;
			}
			else {
				for (int j = n - i -1; j >= 1; j--) {
					cout << " ";
				}
				cout << (char)ch;
				for (int j = 1; j <= 2 * i - 1; j++) {
					cout << " ";
				}
				cout << (char)ch << endl;
			}
		}
		flag = true;
	}
	return 0;
}